package com.harmontronics.hanma.paas.paas.dto.input;

import com.harmontronics.hanma.paas.paas.consts.HttpMethodEnum;
import com.harmontronics.hanma.paas.paas.domain.app.entity.valueobject.BodyTypeEnum;
import com.harmontronics.hanma.paas.paas.domain.app.entity.valueobject.BusinessServiceTypeEnum;
import com.harmontronics.hanma.paas.paas.domain.app.entity.valueobject.HttpRequestDefinitionTypeEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

/**
 * 请求定义
 *
 * @author paas-generator
 * @email paas-generator@harmontronics.com
 * @date 2021-05-18 10:20:57
 */
@Data
public class HmHttpRequestDefinitionCreateInput {


    /**
     * 请求类型
     */
    @ApiModelProperty(value = "请求类型")
    private HttpRequestDefinitionTypeEnum type;

    /**
     * 请求key
     */
    @ApiModelProperty(value = "请求key")
    @NotNull(message = "hm.pass.field_non_nullable")
    @NotEmpty(message = "hm.pass.field_non_nullable")
    @NotBlank(message = "hm.pass.field_non_nullable")
    private String key;

    /**
     * 请求名称
     */
    @ApiModelProperty(value = "请求名称")
    @NotNull(message = "hm.pass.field_non_nullable")
    @NotEmpty(message = "hm.pass.field_non_nullable")
    @NotBlank(message = "hm.pass.field_non_nullable")
    private String name;

    /**
     * 说明
     */
    @ApiModelProperty(value = "说明")
    private String remark;

    /**
     * http请求method
     */
    @ApiModelProperty(value = "http请求method")
    private HttpMethodEnum method;

    /**
     * 请求路径
     */
    @ApiModelProperty(value = "请求路径")
    private String path;

    /**
     * 请求头
     */
    @ApiModelProperty(value = "请求头")
    private String header;

    /**
     * 请求体
     */
    @ApiModelProperty(value = "请求体")
    private String body;

    @ApiModelProperty(value = "请求体类型")
    private BodyTypeEnum bodyType;

    /**
     * 查询值
     */
    @ApiModelProperty(value = "查询值")
    private String query;

    /**
     * 返回值
     */
    @ApiModelProperty(value = "返回值")
    private String response;


    /**
     *模型ID
     */
    @NotNull(message = "hm.pass.field_non_nullable")
    private Long modelId;

    @ApiModelProperty(value = "服务类型")
    @NotNull(message = "hm.pass.field_non_nullable")
    private BusinessServiceTypeEnum serviceType;

    /**
     * 服务方式  仅正对脚本
     */
    private String serviceWay;

    /**
     * 脚本ID
     */
    private Long scriptId;


}
